    new MusicTalk();
    new MusicBrainz();
    new SmoothScroll({ duration: 600 });
    new Player();
    
Listen = {
	getVideos: function(artist, title, hide) { 
      if(!hide) document.getElementById('videos').className = 'tab active';
    
        if(! document.getElementById('videos_c')){
          var videos_div = document.createElement("div");
          videos_div.id = 'videos_c';
          videos_div.className = 'tab_container';
          if(hide) videos_div.style.display = 'none';
          document.getElementById('services').appendChild(videos_div);
      }
  
       if(!hide) Tabs.show('videos', 'videos_c');
  
       if(document.getElementById('videos_c').innerHTML.length)
         return;
      
      videos = new YouTubeVids();
      videos.setTarget('videos_c');
      videos.search(artist,title);
    },
  getInfo: function() {
  	document.getElementById('track_info').className = 'tab active';
    Tabs.show('track_info', 'track_info_c');
  },
  getPlayer: function(id,url){
    player.configure({'id':id,'src': url}).write('player');
  },
  fav: function(track_id,unfav){
    var options = {'target':$('favicon'), 
                  onLoading: function(o, target){ mt.onLoading(target); },
                  onComplete: function(o, target)
                    {
                        var r = o.responseXML.getElementsByTagName('result')[0] 
                        if(r && r.firstChild.nodeValue == 'OK') {
                           target.href = 'javascript:Listen.fav('+track_id+(unfav?'':',1')+');';
                           target.innerHTML = unfav?'<img src="img/icons/fave.gif" alt="Song succesfully removed from your playlist. Click icon to add it to the playlist" title="Song succesfully removed from your playlist. Click icon to add it to the playlist" />':'<img src="img/icons/unfav.png" title = "Song succesfully added to your playlist. Click icon to remove it from the playlist" />';
                        }
                       else { alert('ERROR: '+r.firstChild.nodeValue); }
                    },
                   data:'op=fav'+(unfav?'&unfav=1&':'&')+'track_id='+track_id
                            
          };
                  
    new Ajax().makeRequest('proxy.php', options);
  }
}
